import 'package:library_base/entities/generated/json/base/json_field.dart';
import 'package:library_base/entities/generated/json/purchase_order_entity.g.dart';
import 'dart:convert';

import 'package:library_base/entities/purchase_order_child_entity.dart';
import 'package:library_base/entities/suppliers_shops_list_entity.dart';

@JsonSerializable()
class PurchaseOrderEntity {
  late String purchaseId;
  late String purchaseOrderNumber;
  late double purchaseAmount;
  late double purchaseCount;
  late String payStatus;
  late String purchaseTime;
  String? remark;
  late String supplierName;
  late double totalCost;
  late List<PurchaseOrderChildEntity> details;
  SuppliersShopsListEntity? shop;

  PurchaseOrderEntity();

  factory PurchaseOrderEntity.fromJson(Map<String, dynamic> json) => $PurchaseOrderEntityFromJson(json);

  Map<String, dynamic> toJson() => $PurchaseOrderEntityToJson(this);

  @override
  String toString() => json.encode(this);
}
